package es.qplayas;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import es.qplayas.core.Playa;

public class Details extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
	       super.onCreate(savedInstanceState);
			setContentView(R.layout.details);
			Bundle extras = getIntent().getExtras();
			Playa playa = (Playa)extras.getSerializable("playa");
			TextView title = (TextView) findViewById(R.id.title);
			TextView city = (TextView) findViewById(R.id.city);
			TextView province = (TextView) findViewById(R.id.province);
			TextView distance = (TextView) findViewById(R.id.distance);
			TextView length = (TextView) findViewById(R.id.length);
			TextView width = (TextView) findViewById(R.id.width);
			TextView ocupation = (TextView) findViewById(R.id.ocupation);
			TextView promenade = (TextView) findViewById(R.id.promenade);
			title.setText("Playa: " + playa.getNombre());
			city.setText("Ciudad: " + playa.getLocalidad());
			province.setText("Provincia: " + playa.getProvincia());
			distance.setText("Distancia: " + playa.getDistancia());
			length.setText("Longitud: " + String.valueOf(playa.getCaracteristicas().getLongitud()));
			width.setText("Anchura: " + String.valueOf(playa.getCaracteristicas().getAnchura()));
			ocupation.setText("Grado de ocupación: " + playa.getCaracteristicas().getGradoOcupacion());
			if(playa.getCaracteristicas().isPaseoMaritimo()){
				promenade.setText("Tiene paseo: Sí");
			}else{
				promenade.setText("Tiene paseo: No");
			}
	   }

}
